<html>
<head>
<title>Message Saved</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<%
Dim sUserName
Dim sMessage

Dim oDOM
Dim oRootNode
Dim oEntryNode
Dim oDetailsNode

sUserName = Request("username")
sMessage = Request("message")

Set oDOM = Server.CreateObject("Microsoft.XMLDOM")
oDOM.async = false
oDOM.load server.mappath("xml/msg.xml")

If oDOM.parseError.ErrorCode <> 0 Then ' not found! create an empty document
	oDOM.loadXML "<guestbook/>"
End If

Set oEntryNode = oDOM.documentElement.AppendChild(oDOM.createElement("item"))
 
Set oDetailsNode = oEntryNode.appendChild(oDOM.createElement("username"))
oDetailsNode.appendChild oDOM.createCDATASection(sUserName)
  
Set oDetailsNode = oEntryNode.appendChild(oDOM.createElement("message"))
oDetailsNode.appendChild oDOM.createCDATASection(sMessage)
  
oDOM.Save Server.MapPath("xml/msg.xml")

%>

<script>
history.go(-1);
</script>

